home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
United Public Domain Gold 4
/
United Public Domain Gold 4.iso
/
fredfish
/
ff.0159.dms
/
ff.0159.adf
/
Free
/
Free.c
< prev
next >
Wrap
C/C++ Source or Header
|
1988-10-02
|
1KB
|
43 lines
/*****************************************************************************
********** **********
********** FREE - Displays a short memory & task report **********
********** **********
******************************************************************************
********** **********
********** Designed by Magic Ceee 1987 **********
********** **********
*****************************************************************************/
#include "exec/types.h"
#include "exec/tasks.h"
#include "exec/execbase.h"
#include "exec/memory.h"
extern struct ExecBase *SysBase;
/*****************************************************************************/
main(argc,argv)
int argc;
char *argv[];
{
struct Task *task;
long free,task_counter=0;
char name[200],msg[100];
Disable();
for(task=(struct Task *)SysBase->TaskWait.lh_Head;
task->tc_Node.ln_Succ;
task=(struct Task *)task->tc_Node.ln_Succ) task_counter++;
free=AvailMem(MEMF_CHIP)+AvailMem(MEMF_FAST);
Enable();
if(argc<2) strcpy(name,"Darling");
else strcpy(name,argv[1]);
sprintf(msg,"\n\n%s, there are
%ld
bytes available today. Exec manages
%ld
tasks.\n\n",name,free,task_counter);
Write(Output(),msg,strlen(msg));
}